<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>人物列表主页</title>
</head>
<body>
<div align="center">
    <h1>人物列表</h1>
    <hr>
    <div><a href="/test_view/add_person/">增加一条记录</a></div>
    <br>
    <table cellspacing=16px>
        <thead>
        <tr align="center">
            <th>头像</th>
            <th>姓名</th>
            <th>邮件</th>
            <th>性别</th>
            <th>附件</th>
            <th colspan="2">操作</th>
        </tr>
        </thead>
        <tbody>
        {% for person in person_list %}
        <tr>
            <td><img src="/media/{{ person.head_img }}" style="height:60px;width:60px;"></td>
            <td>{{ person.name }}</td>
            <td>{{ person.email }}</td>
            <td>{{ person.get_gander_display }}</td> <!-- # 取得性别的显示值//-->
            <td><a href="/media/{{ person.attachment }}">查看附件内容</a></td>
            <td><a href="/test_view/del_person/{{ person.id }}/">删除</a></td>
            <td><a href="/test_view/edit_person/{{ person.id }}/">修改</a></td>
        </tr>
        {% empty %}
        <tr>
            <td colspan="7">无相关记录！</td>
        </tr>
        {% endfor %}
        </tbody>
    </table>

</div>
</body>
</html>
